<?php
namespace Home\Controller;
use Think\Controller;
use Think\AjaxPage;
use Think\Page;
class IndexController extends Controller {
	public function index(){
		$this->display();
	}
    public function ad(){
		$mod = M('ad');
		$list = $mod->where(array('pid'=>1))->field("CONCAT('".C('WEB_URL')."',ad_code) as ad_code")->select();
		exit(json_encode(array('code'=>200,'data'=>$list)));
	}
	public function shop_ad(){
		$mod = M('ad');
		$list = $mod->where(array('pid'=>2))->field("CONCAT('".C('WEB_URL')."',ad_code) as ad_code")->select();
		exit(json_encode(array('code'=>200,'data'=>$list)));
	}
	public function protocol(){
		$mod = M('config');
		$resume = $mod->where(array('name'=>'reg_list'))->getField('value');
		$resume = htmlspecialchars_decode($resume);
		exit(json_encode(array('code'=>200,'data'=>$resume)));
	}
	public function code(){
		$time = time().'000';
		$a = md5("appkey=224a22194bb21e639b6bf0c8&timestamp=$time&random_str=mishangfeng&key=abc9badd0992a185e30fe6ba");
		exit(json_encode(array('data'=>$a,'t'=>$time)));		
	}
	public function contact(){
		$id = M('config')->where(array('id'=>4))->getField('value');
		exit(json_encode(array('code'=>200,'data'=>$id)));	
	}
}